#include <iostream>
#include <bits/stdc++.h>

using namespace std;

void PrintVector(vector<int> &v) {
    for (vector<int>::iterator it = v.begin(); it < v.end(); it++) {
        cout << *it;
        if (it < v.end() - 1) cout << ", ";
    }
    cout << endl;
}

void BubbleSort(vector<int> v) {
    for (int i = 0; i < v.size() - 1; ++i) {
        for (int j = 0; j < v.size() - 1 - i; ++j) {
            if (v[j] > v[j + 1]) {
                // 交换
                int tmp = v[j];
                v[j] = v[j + 1];
                v[j + 1] = tmp;
            }
        }
        PrintVector(v);
    }

}

int main() {
    vector<int> v = {3, 5, 6, 2, 1, 7, 0};

    BubbleSort(v);
    return 0;
}